package com.gdglc.PetySys.dao;

import java.util.List;

import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.gdglc.PetySys.model.Pet;
import com.gdglc.PetySys.service.PetService;

public class Test {
	public static void main(String[] args) {
		ApplicationContext context=new ClassPathXmlApplicationContext("spring-mybatis.xml");
		Object dataSource=context.getBean("dataSource");
		System.out.println(dataSource);
		
	/*	PetDao pv=context.getBean("petDao",PetDao.class);
		 List<Pet> pet = pv.getAllPet();
				for (Pet info : pet) {
					System.out.println(info);					
				}*/
		
	PetService pv=context.getBean("petService",PetService.class);
		 List<Pet> pet = pv.getAllPet();
				for (Pet info : pet) {
					System.out.println(info);					
				}
	}
}
